package com.sicnu.cheer.leaugebar.eventmodule.wights;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * Created by cheer on 2017/2/28.
 * 自定义Imageview,
 */

public class MyImageView extends ImageView{

    public MyImageView(Context context) {
        super(context);
    }

    public MyImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyImageView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int screenHeight = widthMeasureSpec / 2;
        setMeasuredDimension(widthMeasureSpec,screenHeight);
    }
}
